package cn.yuanqiao.archive.api.service.impl;

import java.util.List;

import cn.yuanqiao.archive.api.domain.ReceiveRecord;
import cn.yuanqiao.archive.api.mapper.ReceiveRecordMapper;
import cn.yuanqiao.archive.api.service.IReceiveRecordService;
import cn.yuanqiao.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * 接收记录Service业务层处理
 *
 * @author xy
 * @date 2025-01-17
 */
@Service
public class ReceiveRecordServiceImpl implements IReceiveRecordService
{
    @Autowired
    private ReceiveRecordMapper receiveRecordMapper;

    /**
     * 查询接收记录
     *
     * @param id 接收记录主键
     * @return 接收记录
     */
    @Override
    public ReceiveRecord selectReceiveRecordById(Long id)
    {
        return receiveRecordMapper.selectReceiveRecordById(id);
    }

    /**
     * 查询接收记录列表
     *
     * @param receiveRecord 接收记录
     * @return 接收记录
     */
    @Override
    public List<ReceiveRecord> selectReceiveRecordList(ReceiveRecord receiveRecord)
    {
        return receiveRecordMapper.selectReceiveRecordList(receiveRecord);
    }

    /**
     * 新增接收记录
     *
     * @param receiveRecord 接收记录
     * @return 结果
     */
    @Override
    public int insertReceiveRecord(ReceiveRecord receiveRecord)
    {
        receiveRecord.setCreateTime(DateUtils.getNowDate());
        return receiveRecordMapper.insertReceiveRecord(receiveRecord);
    }

    /**
     * 修改接收记录
     *
     * @param receiveRecord 接收记录
     * @return 结果
     */
    @Override
    public int updateReceiveRecord(ReceiveRecord receiveRecord)
    {
        return receiveRecordMapper.updateReceiveRecord(receiveRecord);
    }

    /**
     * 批量删除接收记录
     *
     * @param ids 需要删除的接收记录主键
     * @return 结果
     */
    @Override
    public int deleteReceiveRecordByIds(Long[] ids)
    {
        return receiveRecordMapper.deleteReceiveRecordByIds(ids);
    }

    /**
     * 删除接收记录信息
     *
     * @param id 接收记录主键
     * @return 结果
     */
    @Override
    public int deleteReceiveRecordById(Long id)
    {
        return receiveRecordMapper.deleteReceiveRecordById(id);
    }
}
